package com.atguigu.process.client;

import com.yellowframework.cloud.common.annotation.FeignLogin;
import com.yellowframework.cloud.common.client.YellowCloudServerList;
import com.yellowframework.cloud.common.model.response.ObjectResponseResult;
import com.yellowframework.cloud.domain.system.ext.SysUserExt;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = YellowCloudServerList.YELLOW_CLOUD_SYSTEM)
public interface SystemClient {

    @FeignLogin
    @GetMapping("/sys/user/info")
    SysUserExt info(@RequestParam String username);

    @GetMapping("/sys/user/info/{userId}")
    ObjectResponseResult<SysUserExt> info(@PathVariable("userId") Integer userId);
}
